/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       override_input_handler.h

	$Header: /game/override_input_handler.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef OVERRIDE_INPUT_HANDLER_H_INCLUDED
#define OVERRIDE_INPUT_HANDLER_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <vector>
#include "game_window.h"
#include "handler.h"

class  t_override_input;
struct t_mouse_event;

// ---------------------------------------------------------------
// class to set a callback handler for any mouse or keyboard press
// ---------------------------------------------------------------
class t_override_input
{
public:
	t_override_input();
	t_override_input( bool has_mouse_event );

	~t_override_input();

	void			common_constructor();

	t_handler get_input_handler() const;	
	void			mouse_event( t_mouse_event* event, bool* result );
	void			non_handled_mouse_event( t_mouse_event* event, bool* result );

	// set callback handler for any mouse click.
	void			set_input_handler( t_handler const& function );

private:
	t_handler m_input_handler;
	bool			m_handle_mouse_event;	
};

// ---------------------------------------------------------------
// class to set a callback handler for any mouse or keyboard press
// ---------------------------------------------------------------
inline t_handler t_override_input::get_input_handler() const
{
	return m_input_handler;
}

// ---------------------------------------------------------------
// class to set a callback handler for any mouse or keyboard press
// ---------------------------------------------------------------
inline void t_override_input::set_input_handler( t_handler const& function )
{
	m_input_handler = function;
}

// --------------------------------------------------------
// --------------------------------------------------------

#endif // OVERRIDE_INPUT_HANDLER_H_INCLUDED
